package com.xcity.pomelo.response;

import com.xcity.db.entity.Employee;
import com.xcity.game.buildv2.BuildV2;

import naga.x.net.impl.pomelo.PomeloMessage;
import naga.x.net.impl.pomelo.protocol.Message;

@PomeloMessage(type = Message.Type.RESPONSE)
public class EmployeeWorkResponse extends Response {

	public int buildId; // 建筑id
	public long id; // 员工id
	public String icon; // 员工头像
	public int pos; // 员工所在建筑槽位索引
//	@Deprecated
//	public int defense, reserve, cure; // 建筑抵抗力、储备力、自救力
	public int takeMoneyElapseSec;//距离上一次开始产钱多少秒
	
//	@Deprecated
//	public EmployeeWorkResponse(int serial, Build build, Employee employee, int pos) {
//		super(serial);
//		this.buildId = build.getId();
//		this.defense = (int) build.getDefense();
//		this.reserve = build.getReserve();
//		this.cure = build.getCure();
//		this.id = employee.getId();
//		this.icon = employee.getIcon();
//		this.pos = pos;
//	}
	
	public EmployeeWorkResponse(int serial, BuildV2 build, Employee employee, int pos) {
		super(serial);
		this.buildId = build.getId();
		this.takeMoneyElapseSec = build.calcTakeMoneyElapseSecond();
		this.id = employee.getId();
		this.icon = employee.getIcon();
		this.pos = pos;
	}

}
